package TI;

public class Address {

	private String street;
	private int number;
	private String city;
	private String zipCode;
	private String state;
	private String country;
	
	
	
	
	public Address(String street, int number, String city, String zipCode, String state, String country) {
		this.street = street;
		this.number = number;
		this.city = city;
		this.zipCode = zipCode;
		this.state = state;
		this.country = country;
	}


	public String getStreet() {
		return this.street;
	}


	public int getNumber() {
		return this.number;
	}


	public String getCity() {
		return this.city;
	}

	
	public String getZipCode() {
		return this.zipCode;
	}


	public String getState() {
		return this.state;
	}


	public String getCountry() {
		return this.country;
	}



	public boolean isEquals(Address addressToCompare) {
		boolean retorno = false;
		if(this.getStreet().equals(addressToCompare.getStreet()) & this.getNumber()==addressToCompare.getNumber() & this.getCity().equals(addressToCompare.getCity()) &
			this.getZipCode().equals(addressToCompare.getZipCode()) & this.getState().equals(addressToCompare.getState()) & this.getCountry().equals(addressToCompare.getCountry())){
			
			retorno = true;
		}
		return retorno;
	}
	
	
	public String toString() {
		String retorno = "";
		if(this.getNumber() < 0){
			retorno = "s/n";
		}else{
			retorno = String.valueOf(this.getNumber());
		}		
		retorno = this.getStreet()+", "+retorno+", "+this.getCity()+", "+this.getZipCode()+", "+this.getState()+", "+this.getCountry()+".";		
		return retorno;
	}
	
	

}
